// 全局过滤器
import {
    uploadPictureUrl,
    basePictureUrl
} from '@/utils/common'

let pictureUrl = function(val) {
    if (val && val.split(0, 4) == "http") {
        return val
    }
    return basePictureUrl + val
}
let baseUpPUrl = function(val) {
    return uploadPictureUrl
}
let roleTypeToName = function(val) {
    var roleTypeName = {
        1: '文章',
        2: '用户',
        3: '相册',
        4: '照片'
    }
    return roleTypeName[val]
}
export {
    pictureUrl,
    baseUpPUrl,
    roleTypeToName
} //导出过滤函数